package com.ny.wiw;

import ketanglianxi.BankAccount;

public class Demo {
    public static void main(String[] args) {
        // 创建银行账户对象
        BankAccount account = new BankAccount(1000.0);

        // 查看余额
        System.out.println("当前余额: " + account.getBalance());

        // 存款
        account.deposit(500.0);

        // 尝试取款
        account.withdraw(200.0);
        account.withdraw(2000.0);  // 这会失败，因为余额不足

        // 再次查看余额
        System.out.println("最终余额: " + account.getBalance());
    }
}